const { defineConfig } = require("@vue/cli-service");
const path = require("path");
let { NODE_ENV } = process.env;
function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    hot: true,
    host: "0.0.0.0",
    port: 8080,
    open: true,
    compress: false, //SSE请求一定要把他设置为false，不然得话，不会有打印机的效果。 告诉 dev-server 在服务器端启用 gzip 压缩，用于减少服务器向前端传输的数据量，提高浏览的速度。
    // ... 其他 devServer 配置
    client: {
      overlay: false, // 关闭覆盖层(报错展示的遮罩层)
    },
    proxy: {},
  },
  configureWebpack: {
    name: "教学系统",
    devtool: NODE_ENV === "development" ? "source-map" : undefined,
    mode: NODE_ENV === "development" ? "development" : "production", //只有是production环境时，TerserPlugin或者UglifyjsWebpackPlugin 插件才能生效
    resolve: {
      alias: {
        "@": resolve("src"),
        api: resolve("src/api"),
        components: resolve("src/components"),
        utils: resolve("src/utils"),
        views: resolve("src/views"),
        styles: resolve("src/styles"),
        common: resolve("src/common"),
      },
    },
    plugins: [],
    optimization: {},
  },
});
